Day 9 - Fields

31

Exercises

Time for some exercises! At this point we have a pretty good amount of tools in our belt, so we can

start performing useful tasks. Let’s consider the simple.log file, which represents the part of the logs

of a web server (a simplified version of an actual log of the Apache server). Remember that you can

print the content of the file beforehand with either cat or head

Exercise 9.01

Print fields 1,6,7, and 8 of the file simple.log

Go to solution

Exercise 9.02

Extract the time of each request as HH:MM:SS

Go to solution

Speaking of cutting, we made it in one piece apparently. Well, at least I am still OK, on the bus on

my way to the office. Where are you? If you are commuting I hope you’ll get soon to your office or

home, and in this second case that you can have a good time relaxing and not worrying too much

about fields.

Suggested film for the evening: Edward Scissorhands (1991) - Cutting has never been more fun!